from worker.yuqing.crawler.Similarity.Analyse import Analyse


class Manage:
    def __init__(self, text, article_dict):
        self.article_dict = article_dict
        self.text = text
        self.analyse = Analyse()

    def get_local_analyse(self):
        """

        :return: 文章相似度比对结果
        """
        resdic = {}

        for k in self.text:
            res = {}
            for k1 in self.article_dict:
                res[k1] = self.analyse.get_Tfidf(self.article_dict[k1], self.text[k])
            resdic[k] = res
        return resdic
